<?php

/**
 * JCLIC_ACTIVITIES filter form base class.
 *
 * @package    Projecte Final de Carrera
 * @subpackage filter
 * @author     Jaume Fernandez
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseJCLIC_ACTIVITIESFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'activity_name'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'num_actions'     => new sfWidgetFormFilterInput(),
      'score'           => new sfWidgetFormFilterInput(),
      'activity_solved' => new sfWidgetFormFilterInput(),
      'qualification'   => new sfWidgetFormFilterInput(),
      'total_time'      => new sfWidgetFormFilterInput(),
      'activity_code'   => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'activity_name'   => new sfValidatorPass(array('required' => false)),
      'num_actions'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'score'           => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'activity_solved' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'qualification'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'total_time'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'activity_code'   => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('jclic_activities_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'JCLIC_ACTIVITIES';
  }

  public function getFields()
  {
    return array(
      'session_id'      => 'Text',
      'activity_id'     => 'Number',
      'activity_name'   => 'Text',
      'num_actions'     => 'Number',
      'score'           => 'Number',
      'activity_solved' => 'Number',
      'qualification'   => 'Number',
      'total_time'      => 'Number',
      'activity_code'   => 'Text',
    );
  }
}
